/*
 * Copyright (C) 2021 Baidu, Inc. All Rights Reserved.
 */
package com.chukun.rpc.core;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;

/**
 * <p>rpc框架请求的临时保存类<p/>
 *
 * @author chukun
 * @version 1.0
 * @since 1.0-SNAPSHOT
 */
public class TinyRpcRequestHolder {

    public final static AtomicLong REQUEST_ID_GEN = new AtomicLong();

    public static final Map<Long, TinyRpcFuture<TinyRpcResponse>> REQUEST_MAP = new ConcurrentHashMap<>();

    public static AtomicLong getRequestIdGen() {
        return REQUEST_ID_GEN;
    }

    public static Map<Long, TinyRpcFuture<TinyRpcResponse>> getRequestMap() {
        return REQUEST_MAP;
    }
}
